package com.sevenluo.netty.learn.common.auth;

import com.sevenluo.netty.learn.common.Operation;
import lombok.Data;
import lombok.extern.java.Log;

/**
 * @author: 程序员七哥
 * @date: 2022-01-25
 * @description:
 */
@Data
@Log
public class AuthOperation extends Operation {

    private final String username;

    private final String password;

    @Override
    public AuthOperationResult execute() {

        if ("admin".equalsIgnoreCase(this.username)) {
            return new AuthOperationResult(true);
        }
        return new AuthOperationResult(false);
    }
}
